package com.jihu.rpc.server.invoke;

import com.huge.rpc.Request;
import com.huge.rpc.common.utils.ReflectionUtils;
import com.jihu.rpc.server.instance.ServiceInstance;

/**
 * @author jihu
 * @date 2020/10/14
 */
public class ServiceInvoke {
    public Object invoke(ServiceInstance serviceInstance,
                         Request request){
        return ReflectionUtils.invoke(
                serviceInstance.getTarget(),
                serviceInstance.getMethod(),
                request.getParameters());
    };
}
